/**
 * 
 */
package com.feib.stms.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.feib.stms.model.Group;
import com.feib.stms.pagination.PaginatedList;

/**
 * @author Lion Gao
 *
 */
@Transactional(readOnly = true)
public interface GroupService 
{
	/** 
	 * 根據pk查詢
	 * @param groupPk
	 * @return Group
	 */
	public Group getByGroupPk(Long groupPk);
	
	/** 
	 * 根據代碼查詢(完全比對)
	 * @param groupNo
	 * @return Group
	 */
	public Group getByGroupNo(String groupNo);
	
	/** 
	 * 分頁查詢券商維護作業
	 * @param group
	 * @param paginatedList
	 * @return PaginatedList<Group>
	 */
	public PaginatedList<Group> findForPaginatedListByGroup(Group group , PaginatedList<Group> paginatedList);
	
	/** 
	 * 新增券商維護作業
	 * @param menuItem
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int saveGroup(Group group);
	
	/** 
	 * 修改券商維護作業
	 * @param group
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int updateGroup(Group group);
	
	/** 
	 * 統計券商代號重複
	 * @param groupPk
	 * @param groupNo
	 * @return int
	 */
	public int countGroupNo(Long groupPk , String groupNo);
	
	/** 
	 * 統計券商代號重複
	 * @param groupNo
	 * @return int
	 */
	public int countGroupNo(String groupNo);

	/**
     * 依據查詢物件查詢券商,排除銀行端資料
     * @param group 查詢條件
     * @param paginationConfig 換頁、排序條件
     * @return 查詢結果物件
     */
	public PaginatedList<Group> queryByGroupExcludeBank(Group qryGroup,
			PaginatedList<Group> paginatedList);
	
	/**
	 * 查詢全部的群組
	 * @return
	 */
	public List<Group> findAllGroup();
}
